package com.zhuiyi.homeworkstudent.service.impl;

import com.zhuiyi.homeworkstudent.entity.Student;
import com.zhuiyi.homeworkstudent.mapper.StudentMapper;
import com.zhuiyi.homeworkstudent.service.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    private StudentMapper studentMapper;
    @Override
    public List<Student> allStudent() {
        List<Student> studentList = studentMapper.getAllStudent();
        return studentList;
    }

    @Override
    public void addStudent(Student student) {
         studentMapper.addStudent(student);
    }

    @Override
    public void deleteStudentById(int id) {
        studentMapper.deleteStudent(id);
    }

    @Override
    public void updateStudent(Student student) {
        studentMapper.updateStudent(student);
    }

    @Override
    public Student searchStudentById(int id) {
        return studentMapper.searchOneStudent(id);

    }


}
